<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background: yellow;
            position: relative;
            /* z-index: 100; */
        }
        .child{
            width: 100px;
            height: 100px;
            background: red;
            position: absolute;
            top: 10px;
            left: 10px;
            /*设置子盒子为负数*/
            z-index: -1;    
        }
        .box1{
            width: 200px;
            height: 200px;
            background: yellow;
            position: absolute;
            top: 100px;
            left: 100px;
            z-index: 100;
        }
        .box2{
            width: 200px;
            height: 200px;
            background: red;
            position: absolute;
            top: 0px;
            left: 0px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="child"></div>
    </div>

    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>